package mock;

import data.ReservationResponse;
import data.ReservationPlan;

import java.util.List;
import java.util.LinkedList;

/**
 * User: Inbal
 * Date: 22/03/2009
 * Time: 18:03:09
 */
public class GoOutServer {
	public static boolean allreadyResgistered(String reservationName) {
		return !"test".equals(reservationName);
	}

	public static List<String> getRestaurantTypes(){
		LinkedList<String> res = new LinkedList<String>();
		res.add("Italian");
		res.add("Shit");
		return res; 
	}

	public static List<String> getMovies(){
		LinkedList<String> res = new LinkedList<String>();
		res.add("Movie1");
		res.add("Movie2");
		return res;
	}

	public static ReservationResponse reserve(ReservationPlan plan){
		ReservationResponse response = new ReservationResponse();
		if("test".equals(plan.getReservationName())){
			response.setSuccess(true);
			response.setMsg("Plan reserved successfully");
		}else{
			response.setSuccess(false);
			response.setMsg("No places left in the restaurant.\nPlease try again in a different restaurant or at a different date.");
		}
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
		}
		return response;
	}
}
